Skip to content

feat: Add infrastructure management commands to Makefile#5

Open
m1ngsama wants to merge 1 commit intomainfrom
feature/makefile-infrastructure-commands
Open

feat: Add infrastructure management commands to Makefile#5
m1ngsama wants to merge 1 commit intomainfrom
feature/makefile-infrastructure-commands

Conversation

@m1ngsama
Copy link
Owner

Summary

Enhance Makefile with infrastructure service management commands for easy deployment and operations.

New Commands

Setup Commands

make network-create    # Create Docker networks
make network-remove    # Remove Docker networks

Infrastructure Management

make infra-up          # Start all infrastructure services
make infra-down        # Stop all infrastructure services
make infra-status      # Check infrastructure status

Full Stack Management

make up                # Start infrastructure + services
make down              # Stop everything

Infrastructure Services Managed

  1. Caddy - Reverse proxy with auto HTTPS
  2. Monitoring - Prometheus, Grafana, Loki, Promtail, cAdvisor
  3. Watchtower - Automatic updates
  4. Duplicati - Remote backups
  5. Fail2ban - Security

Usage Example

# Initial setup
make network-create
make up

# Check status
make status
make infra-status

# Stop everything
make down

Command Hierarchy

make up
├── make infra-up (infrastructure)
│   ├── make network-create
│   └── docker compose up (5 services)
└── make all-up (applications)
    ├── minecraft
    ├── teamspeak
    └── nextcloud

Enhanced Help Output

Updated make help with categorized commands:

  • Setup Commands
  • Infrastructure Commands
  • Global Commands
  • Service-specific Commands

Improvements

  • ✅ Hierarchical service management
  • ✅ Graceful shutdown order (apps → infra)
  • ✅ Network prerequisites checked automatically
  • ✅ Consistent error handling
  • ✅ Clear command organization

Breaking Changes

None - all existing commands preserved, only additions.

Dependencies

Testing

Tested locally and on remote server (greenarch) with:

  • Docker 28.5.1
  • Docker Compose v2
  • Arch Linux

Ready for review - Completes the infrastructure implementation trilogy (docs → infra → commands)

Enhance Makefile with infrastructure service management:

**New Commands:**
- `network-create`: Create Docker networks (automa-proxy, automa-monitoring)
- `network-remove`: Remove Docker networks
- `infra-up`: Start all infrastructure services (Caddy, monitoring, etc.)
- `infra-down`: Stop all infrastructure services
- `infra-status`: Check status of infrastructure services
- `up`: Start infrastructure + all application services
- `down`: Stop all services + infrastructure

**Command Structure:**
```
make network-create  # Setup networks first
make infra-up        # Start infrastructure
make all-up          # Start applications
# Or simply: make up  (does all above)
```

**Infrastructure Services Managed:**
1. Caddy (reverse proxy)
2. Monitoring stack (Prometheus, Grafana, Loki, Promtail, cAdvisor)
3. Watchtower (auto-updates)
4. Duplicati (backups)
5. Fail2ban (security)

**Improvements:**
- Hierarchical service management (infra → apps)
- Graceful shutdown order (apps → infra)
- Network prerequisites automatically checked
- Enhanced help text with categorized commands
- Consistent error handling

Follows Unix philosophy: compose simple commands for complex workflows.

Refs: #4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant